package com.moter.one.wyydemo1.controller;

import com.moter.one.wyydemo1.backstage.vo.DataVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;


@Controller
public class Logout {

    /**
     * 用户退出登录接口
     */
    @ResponseBody
    @RequestMapping("/user/logout")
    public DataVo logout(HttpSession session){
        session.invalidate();
        DataVo dataVo = new DataVo(0, "登录已退出");
        return dataVo;
    }

}
